#include "hitlist/hit_container.hpp"
#include <iostream>
int main()
{
  hit_container hc;

  time_t hit_time = time(0) - 3600*24*2;
  
  hc.hit(1, 2, hit_time);
  hit_time = time(0)-60*4;
  hc.hit(1, 2, hit_time);
  hit_time+=30;
  hc.hit(1, 2, hit_time);
  hit_time+=59;
  hc.hit(1, 2, hit_time);
  hit_time+=61;
  hc.hit(1, 2, hit_time);
  hit_time+=61;
  hc.hit(1, 3, hit_time);
  std::cout << hc.hits_size() << std::endl;
  std::cout << hc.hosts_size() << std::endl;
  std::cout << "first "<<1 << " hits day: " << hc.hits_day(1) << std::endl;
  std::cout << "first "<<1 << " hosts day: " << hc.hosts_day(1) << std::endl;
  std::cout << "first "<<1 << " hits month: " << hc.hits_month(1) << std::endl;
  std::cout << "first "<<1 << " hosts month: " << hc.hosts_month(1) << std::endl;
  std::vector<hit_item> hitlist_day;
  hc.day_hitlist(1, 0, 50, hitlist_day);
  std::cout << "day size:" << hitlist_day.size() << std::endl;
  std::vector<hit_item> hitlist_month;
  hc.day_hitlist(1, 0, 50, hitlist_month);
  std::cout << "month size:" << hitlist_month.size() << std::endl;
  

  std::cout << "--------------------------------------------------" << std::endl;
  std::cout << "first "<<2 << " hits day: " << hc.hits_day(2) << std::endl;
  std::cout << "first "<<2 << " hosts day: " << hc.hosts_day(2) << std::endl;
  std::cout << "first "<<2 << " hits month: " << hc.hits_month(2) << std::endl;
  std::cout << "first "<<2 << " hosts month: " << hc.hosts_month(2) << std::endl;
  std::vector<hit_item> hitlist_day2;
  hc.day_hitlist(2, 0, 50, hitlist_day2);
  std::cout << "day size:" << hitlist_day2.size() << std::endl;
  std::vector<hit_item> hitlist_month2;
  hc.day_hitlist(2, 0, 50, hitlist_month2);
  std::cout << "month size:" << hitlist_month2.size() << std::endl;
  std::cout << "--------------------------------------------------" << std::endl;

  hit_time = time(0)-60*120;
  hc.hit(2, 5, hit_time + 120);
  hc.hit(2, 6, hit_time + 2*120);
  hc.hit(2, 5, hit_time + 3*120);
  hc.hit(2, 6, hit_time + 4*120);
  std::cout << "first "<<2 << " hits day: " << hc.hits_day(2) << std::endl;
  std::cout << "first "<<2 << " hosts day: " << hc.hosts_day(2) << std::endl;
  std::cout << "first "<<2 << " hits month: " << hc.hits_month(2) << std::endl;
  std::cout << "first "<<2 << " hosts month: " << hc.hosts_month(2) << std::endl;

  
  hc.day_hitlist(2, 0, 50, hitlist_day2);
  std::cout << "day size:" << hitlist_day2.size() << std::endl;
  
  hc.day_hitlist(2, 0, 50, hitlist_month2);
  std::cout << "month size:" << hitlist_month2.size() << std::endl;

  
return 0;
}
